#!/bin/bash
#    am-help-pipemenu - an Openbox pipemenu for displaying help files
#    Copyright (C) 2015 damo    <damo@bunsenlabs.org>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.


HELP='    am-help-pipemenu an Openbox Pipe Menu for displaying help files
    It should normally be called from an openbox menu.

Options (usually passed from the menu):
    -h --help   show this message

    If am-help-pipemenu is called with no options (the usual method),
    it will output an xml openbox pipemenu displaying various help files,
    both online and on the system.
'
# look for a help option somewhere
for i in "$@"
do
    case "$i" in
    -h|--help)
        echo "$HELP"
        exit 0
        ;;
    esac
done

AL_COMMON_LIBDIR='/usr/lib/arcolinux/common'

if ! . "$AL_COMMON_LIBDIR/am-include.cfg" 2> /dev/null; then
    echo $"Error: Failed to source am-include.cfg in $AL_COMMON_LIBDIR" >&2
    exit 1
fi

menuStart

menuSeparator 'Need To Know'
menuSeparator
menuItem 'Information about this release' 'exo-open "https://arcolinux.info/arcolinux-editions/"'
menuSeparator 'ArcoLinux Online'
menuSeparator
menuItem 'ArcoLinux Info' 'exo-open "https://arcolinux.info/"'
menuItem 'ArcoLinux' 'exo-open "http://arcolinux.com"'
menuItem 'ArcoLinuxD' 'exo-open "http://arcolinuxd.com"'
menuItem 'ArcoLinuxB' 'exo-open "http://arcolinuxb.com"'
menuItem 'ArcoLinuxIso' 'exo-open "http://arcolinuxiso.com"'
menuItem 'ArcoLinux Forum' 'exo-open "http://arcolinuxforum.com"'
menuItem 'ArcoLinux Facebook' 'exo-open "https://www.facebook.com/arcolinuxd"'
menuItem 'ArcoLinux Youtube' 'exo-open "https://www.youtube.com/erikdubois"'
menuEnd
